﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ModularFixture.CApMFPlacementPoint
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections;


namespace DnProcessSimulateCommands.ModularFixture;

internal class CApMFPlacementPoint
{
  private string m_name;
  private CApMFPlacementPointGridRow m_x;
  private CApMFPlacementPointGridRow m_y;
  private CApMFPlacementPointGridRow m_z;
  private CApMFPlacementPointGridRow m_rx;
  private CApMFPlacementPointGridRow m_ry;
  private CApMFPlacementPointGridRow m_rz;
  private int m_intermediateUnitId;

  public CApMFPlacementPoint(
    string name,
    CApMFPlacementPointGridRow x,
    CApMFPlacementPointGridRow y,
    CApMFPlacementPointGridRow z,
    CApMFPlacementPointGridRow rx,
    CApMFPlacementPointGridRow ry,
    CApMFPlacementPointGridRow rz)
  {
    this.m_name = name;
    this.m_x = x;
    this.m_y = y;
    this.m_z = z;
    this.m_rx = rx;
    this.m_ry = ry;
    this.m_rz = rz;
    this.m_intermediateUnitId = 0;
  }

  public ArrayList ToArray()
  {
    ArrayList array = new ArrayList();
    array.Add((object) this.m_name);
    array.AddRange((ICollection) this.m_x.ToArray());
    array.AddRange((ICollection) this.m_y.ToArray());
    array.AddRange((ICollection) this.m_z.ToArray());
    array.AddRange((ICollection) this.m_rx.ToArray());
    array.AddRange((ICollection) this.m_ry.ToArray());
    array.AddRange((ICollection) this.m_rz.ToArray());
    return array;
  }

  internal static ArrayList Parse(string[] points)
  {
    ArrayList arrayList = new ArrayList();
    int index = 0;
    while (index < points.Length)
    {
      string point = points[index];
      ++index;
      CApMFPlacementPointGridRow placementPointGridRow1 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPointGridRow placementPointGridRow2 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPointGridRow placementPointGridRow3 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPointGridRow placementPointGridRow4 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPointGridRow placementPointGridRow5 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPointGridRow placementPointGridRow6 = CApMFPlacementPoint.ParsePlacementPointGridRow(points, ref index);
      CApMFPlacementPoint mfPlacementPoint = new CApMFPlacementPoint(point, placementPointGridRow1, placementPointGridRow2, placementPointGridRow3, placementPointGridRow4, placementPointGridRow5, placementPointGridRow6);
      arrayList.Add((object) mfPlacementPoint);
    }
    return arrayList;
  }

  private static CApMFPlacementPointGridRow ParsePlacementPointGridRow(
    string[] points,
    ref int index)
  {
    CApMFPlacementPointGridRow placementPointGridRow = (CApMFPlacementPointGridRow) null;
    switch (CApMFPlacementPointGridRow.GetTypeFromString(points[index]))
    {
      case PointType.Exact:
        placementPointGridRow = new CApMFPlacementPointGridRow(Convert.ToDouble(points[++index]), -100.0, 100.0, 10.0, PointType.Exact);
        break;
      case PointType.Step:
        placementPointGridRow = new CApMFPlacementPointGridRow(0.0, Convert.ToDouble(points[++index]), Convert.ToDouble(points[++index]), Convert.ToDouble(points[++index]), PointType.Step);
        break;
      case PointType.Free:
        placementPointGridRow = new CApMFPlacementPointGridRow(0.0, Convert.ToDouble(points[++index]), Convert.ToDouble(points[++index]), 10.0, PointType.Free);
        break;
    }
    ++index;
    return placementPointGridRow;
  }

  public string Name
  {
    get => this.m_name;
    set => this.m_name = value;
  }

  public CApMFPlacementPointGridRow X
  {
    get => this.m_x;
    set => this.m_x = value;
  }

  public CApMFPlacementPointGridRow Y
  {
    get => this.m_y;
    set => this.m_y = value;
  }

  public CApMFPlacementPointGridRow Z
  {
    get => this.m_z;
    set => this.m_z = value;
  }

  public CApMFPlacementPointGridRow RX
  {
    get => this.m_rx;
    set => this.m_rx = value;
  }

  public CApMFPlacementPointGridRow RY
  {
    get => this.m_ry;
    set => this.m_ry = value;
  }

  public CApMFPlacementPointGridRow RZ
  {
    get => this.m_rz;
    set => this.m_rz = value;
  }

  public int IntermediateUnitId
  {
    get => this.m_intermediateUnitId;
    set => this.m_intermediateUnitId = value;
  }
}
